import { $get, $delete } from '@js/request'
import { DepartmentSchema } from '@src/components/schema/departmentSchema'

// 根据租户id获取部门组织树
export async function getDepartmentTreeRequest (code: string): Promise<DepartmentSchema[]> {
  const res = await $get('/api/common/structure', {
    tenant_code: code
  })
  return res.data
}

// 删除部门请求
export async function delDepartmentRequest (id: string): Promise<void> {
  const res = await $delete(`/api/common/structure/${id}`)
  return res.data
}
